home *** CD-ROM | disk | FTP | other *** search
/ PC Users 1998 June / Cd Pc Users 9.iso / prog / inst / anicur / anicur.exe / Animated Cursor.Frm (.txt) next >
Encoding:
Visual Basic Form  |  1997-09-02  |  8.4 KB  |  238 lines

  1. VERSION 4.00
  2. Begin VB.Form AniCursor 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Animated Cursor"
  5.    ClientHeight    =   1830
  6.    ClientLeft      =   2955
  7.    ClientTop       =   2475
  8.    ClientWidth     =   3990
  9.    Height          =   2235
  10.    Icon            =   "Animated Cursor.frx":0000
  11.    Left            =   2895
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    ScaleHeight     =   1830
  15.    ScaleWidth      =   3990
  16.    Top             =   2130
  17.    Width           =   4110
  18.    Begin VB.CommandButton Cancel 
  19.       Caption         =   "&Cancel"
  20.       Height          =   375
  21.       Left            =   2880
  22.       TabIndex        =   1
  23.       Top             =   1320
  24.       Width           =   975
  25.    End
  26.    Begin VB.Timer Timer 
  27.       Enabled         =   0   'False
  28.       Interval        =   200
  29.       Left            =   120
  30.       Top             =   1320
  31.    End
  32.    Begin VB.CommandButton Animate 
  33.       Caption         =   "&Animate Cursor"
  34.       Height          =   375
  35.       Left            =   1200
  36.       TabIndex        =   0
  37.       Top             =   1320
  38.       Width           =   1515
  39.    End
  40.    Begin VB.Image imgPtr 
  41.       Height          =   480
  42.       Index           =   9
  43.       Left            =   2220
  44.       Picture         =   "Animated Cursor.frx":000C
  45.       Top             =   705
  46.       Visible         =   0   'False
  47.       Width           =   480
  48.    End
  49.    Begin VB.Image imgPtr 
  50.       Height          =   480
  51.       Index           =   8
  52.       Left            =   1740
  53.       Picture         =   "Animated Cursor.frx":0316
  54.       Top             =   705
  55.       Visible         =   0   'False
  56.       Width           =   480
  57.    End
  58.    Begin VB.Image imgPtr 
  59.       Height          =   480
  60.       Index           =   7
  61.       Left            =   1260
  62.       Picture         =   "Animated Cursor.frx":0620
  63.       Top             =   705
  64.       Visible         =   0   'False
  65.       Width           =   480
  66.    End
  67.    Begin VB.Image imgPtr 
  68.       Height          =   480
  69.       Index           =   6
  70.       Left            =   780
  71.       Picture         =   "Animated Cursor.frx":092A
  72.       Top             =   705
  73.       Visible         =   0   'False
  74.       Width           =   480
  75.    End
  76.    Begin VB.Image imgPtr 
  77.       Height          =   480
  78.       Index           =   5
  79.       Left            =   270
  80.       Picture         =   "Animated Cursor.frx":0C34
  81.       Top             =   705
  82.       Visible         =   0   'False
  83.       Width           =   480
  84.    End
  85.    Begin VB.Image imgPtr 
  86.       Height          =   480
  87.       Index           =   4
  88.       Left            =   2205
  89.       Picture         =   "Animated Cursor.frx":0F3E
  90.       Top             =   225
  91.       Visible         =   0   'False
  92.       Width           =   480
  93.    End
  94.    Begin VB.Image imgPtr 
  95.       Height          =   480
  96.       Index           =   3
  97.       Left            =   1710
  98.       Picture         =   "Animated Cursor.frx":1248
  99.       Top             =   225
  100.       Visible         =   0   'False
  101.       Width           =   480
  102.    End
  103.    Begin VB.Image imgPtr 
  104.       Height          =   480
  105.       Index           =   2
  106.       Left            =   1215
  107.       Picture         =   "Animated Cursor.frx":1552
  108.       Top             =   225
  109.       Visible         =   0   'False
  110.       Width           =   480
  111.    End
  112.    Begin VB.Image imgPtr 
  113.       Height          =   480
  114.       Index           =   1
  115.       Left            =   720
  116.       Picture         =   "Animated Cursor.frx":185C
  117.       Top             =   225
  118.       Visible         =   0   'False
  119.       Width           =   480
  120.    End
  121.    Begin VB.Image imgPtr 
  122.       Height          =   480
  123.       Index           =   0
  124.       Left            =   270
  125.       Picture         =   "Animated Cursor.frx":1B66
  126.       Top             =   225
  127.       Visible         =   0   'False
  128.       Width           =   480
  129.    End
  130. Attribute VB_Name = "AniCursor"
  131. Attribute VB_Creatable = False
  132. Attribute VB_Exposed = False
  133. Option Explicit
  134. ' Index variable to track current cell in animation
  135. Private CustomPtr As Integer
  136. Private Sub Command1_Click()
  137.    If Not Timer1.Enabled Then
  138.       '
  139.       ' Turn on animation if Timer isn't enabled.
  140.       '
  141.       Timer1.Enabled = True
  142.       Me.MousePointer = vbCustom
  143.       Command1.Caption = "Stop Cursor Animation"
  144.    Else
  145.       '
  146.       ' Turn off animation if Timer is enabled.
  147.       ' Reset MouseIcon and index to position 0.
  148.       '
  149.       Timer1.Enabled = False
  150.       Me.MousePointer = vbDefault
  151.       Command1.Caption = "Animate Cursor"
  152.       CustomPtr = 0
  153.       Me.MouseIcon = imgPtr(CustomPtr)
  154.    End If
  155. End Sub
  156. Private Sub Animate_Click()
  157. If Not Timer.Enabled Then 'turn on animation if Timer isn't enabled.
  158.    Timer.Enabled = True
  159.    Me.MousePointer = vbCustom
  160.    Animate.Caption = "Stop Animation"
  161.    'turn off animation if Timer is enabled.
  162.    'reset MouseIcon and index to position 0.
  163.    Timer.Enabled = False
  164.    Me.MousePointer = vbDefault
  165.    Animate.Caption = "Animate Cursor"
  166.    CustomPtr = 0
  167.    Me.MouseIcon = imgPtr(CustomPtr)
  168. End If
  169. End Sub
  170. Private Sub Timer1_Timer()
  171.    ' Set MouseIcon to current index, and increment
  172.    ' index (looping back if neccessary).
  173.    ' Use cursors designed for B&W if Win16, or
  174.    ' full color cursors in Win32.
  175.    #If Win16 Then
  176.       Me.MouseIcon = imgPtr(CustomPtr + 10)
  177.    #ElseIf Win32 Then
  178.       Me.MouseIcon = imgPtr(CustomPtr)
  179.    #End If
  180.    CustomPtr = (CustomPtr + 1) Mod 10
  181. End Sub
  182. Private Sub Cancel_Click()
  183. Unload Me 'exit the program
  184. End Sub
  185. Private Sub Form_Load()
  186. Move (Screen.Width - Width) \ 2, (Screen.Height - Height) \ 2 'centre the form on the screen
  187. 'This project was downloaded from
  188. 'http://www.brianharper.demon.co.uk/
  189. '****************************************************
  190. 'and passed trought:
  191. 'K.Driblinov page... tons of C & Vb sources, links to other prg sites!!
  192. 'http://www.geocities.com/SiliconValley/Lakes/7057
  193. 'E-Mail: kdriblinov@hotmail.com
  194. '****************************************************
  195. 'Please use this project and all of its source code however you want.
  196. 'UNZIPPING
  197. 'To unzip the project files you will need a 32Bit unzipper program that
  198. 'can handle long file names. If you have a latest copy of Winzip installed
  199. 'on your system then you may use that. If you however dont have a copy,
  200. 'then visit my web site, go into the files section and from there you can
  201. 'click on the Winzip link to goto their site and download a copy of the
  202. 'program. By doing this you will now beable to unzip the project files
  203. 'retaining their proper long file names.
  204. 'Once upzipped, load up your copy of Visual Basic and goto
  205. 'File/Open Project. Locate the project files to where ever you unzipped
  206. 'them, then click Open. The project files will be loaded and are now ready
  207. 'for use.
  208. 'THE PROJECT
  209. 'This project can be very handy if your programming something that needs to
  210. 'add an animation to it. This project is very basic and uses the actual mouse
  211. 'cursor for the animation. When the mouse is moved over the form, or your
  212. 'program, then the cursor will change to an animation. This can be usfull when
  213. 'first starting your program or in a splash screen of some sort.
  214. 'NOTES
  215. 'I have only provided the necessary project files with the zip. This keeps
  216. 'the size of the zip files down to a minimum and enables me to upload more
  217. 'prjects files to my site.
  218. 'I hope you find the project usful in what ever you are programming. I
  219. 'have tried to write out a small explanation of what each line of code
  220. 'does in the project, although most of it is pretty simple to understand.
  221. 'If you find any bugs in the code then please dont hesitate to Email me and
  222. 'I will get back to you as soon as possible. If you however need help on a
  223. 'different matter concerning Visual Basic then please please Email me as
  224. 'I like to here from people and here what they are programming.
  225. 'My Email address is:
  226. 'Brian@brianharper.demon.co.uk
  227. 'My web site is:
  228. 'http://www.brianharper.demon.co.uk/
  229. 'Please visit my web site and find many other useful projects like this.
  230. End Sub
  231. Private Sub imgPtr_Click(Index As Integer)
  232. End Sub
  233. Private Sub Timer_Timer()
  234. 'set MouseIcon to current index, and increment index (looping back if neccessary).
  235. Me.MouseIcon = imgPtr(CustomPtr)
  236. CustomPtr = (CustomPtr + 1) Mod 10
  237. End Sub
  238.